<?php
//+=============================
//|  公共方法类
//|  time: 2016-06-19 By One
//|  *^_^*
//+=============================

namespace Home\Controller;
use Think\Controller;

class CommonController extends Controller{
 	public function verify()
 	{
 		$config =    array(
		    'fontSize'    =>    17,    // 验证码字体大小
		    'length'      =>    4,     // 验证码位数
		    'useNoise'    =>    true, // 关闭验证码杂点
		);
		$Verify =     new \Think\Verify($config);
		$Verify->entry();

 	}

 	//+---------------
 	//| 短信验证码注册
 	//|	2016.06.20 By One
 	//+---------------
 	public function send_sms($tel)
 	{
 		$tel = $_POST['tel'];

        $code = rand(1000,9999);

 		$verify = D("Common");
        $status = $verify->sendSMS($tel,$code);
        if($status == false){
            $data['info'] = "短信发送失败！";
            $this->ajaxReturn($data);die;
        }else{
        	$data['info'] = 1;
            session("sms_code",$code);
            $this->ajaxReturn($data);

        }
 	}


}